import ajax from './index'
import { append } from './index'

//登录
// export function loginBackground(data) {
//   return ajax.post('/partner_admin/login', data)
// }
export function loginBackground(data) {
  return ajax.post('/backend/admin/login', data)
}

export function userInfo() {
  return ajax.get('/backend/admin/info')
}
//省市区
export function provinceCityArea(data) {
  return ajax.post('/admin/shop/province_city_area', data)
}
//商品列表
export function getProductList(url) {
  return ajax.get('/admin/product/list?' + url)
}

//商品下架
export function productDownProduct(data) {
  return ajax.post('/admin/product/down_product', data)
}

//商品上架
export function productUpProduct(data) {
  return ajax.post('/admin/product/up_product', data)
}

//商品删除
export function productDeleteProduct(data) {
  return ajax.post('/admin/product/delete_product', data)
}

//商品详情
export function productDetailInfo(url) {
  return ajax.get('/admin/product/product_info?' + url)
}

//商品编辑
export function productEditProduct(data) {
  return ajax.post('/admin/product/edit_product', data)
}

//爆品列表
export function getExplosiveProductList(url) {
  return ajax.get('/admin/product/explosive_list?' + url)
}
//爆品下架
export function productDownExplosiveProduct(data) {
  return ajax.post('/admin/product/down_explosive_product', data)
}

//爆品上架
export function productUpExplosiveProduct(data) {
  return ajax.post('/admin/product/up_explosive_product', data)
}

//爆品删除
export function productDeleteExplosiveProduct(data) {
  return ajax.post('/admin/product/delete_explosive_product', data)
}

//爆品详情
export function productDetailExplosiveInfo(url) {
  return ajax.get('/admin/product/explosive_product_info?' + url)
}

//爆品编辑
export function productEditExplosiveProduct(data) {
  return ajax.post('/admin/product/edit_explosive_product', data)
}
//小店分类列表
// export function shopTypeList(data) {
//   return ajax.post('partner_admin/shop/type/list', data)
// }

export function shopTypeList() {
  return ajax({
    url: `/backend/shopType/listAll`,
    method: 'get'
  });
}
//小店分组列表
export function shopGroupList(data) {
  return ajax.post('/admin/shop/group', data)
}

//小店分组详情
export function shopGroupDetail(data) {
  return ajax.post('/admin/shop/group/detail', data)
}

//小店列表
export const shopList = data => {
  return ajax.get(`partner_admin/shop/search${append(data)}`)
}
//修改代理小店分类id
export function shopTypeIdModify(data) {
  return ajax.post('/admin/shop/type_id/modify', data)
}
//小店分类开启关闭
export function shoptypeopenorclose(data) {
  return ajax.post('/admin/shop/type/open_or_close', data)
}
//添加修改小店分类
export function shoptypeaddormodify(data) {
  return ajax.post('/admin/shop/type/add_or_modify', data)
}
//删除小店分类
export function shoptypedel(data) {
  return ajax.post('/admin/shop/type/del', data)
}

//商户列表
export function shopSellerSelect(data) {
  return ajax.post('/admin/shop/seller/select', data)
}

//修改联盟
export function shopAddModifyUnion(data) {
  return ajax.post('/admin/shop/add/modify/union', data)
}

//会员专享列表
export function productVipList(data) {
  return ajax.post('/admin/product/vip/list', data)
}

//vip商品上架
export function productVipUp(data) {
  return ajax.post('/admin/product/vip/up', data)
}

//vip商品下架
export function productVipDown(data) {
  return ajax.post('/admin/product/vip/down', data)
}

//vip商品删除
export function productVipDelete(data) {
  return ajax.post('/admin/product/vip/delete', data)
}

//会员商品详情
export function productVipDetail(data) {
  return ajax.post('/admin/product/vip/detail', data)
}

//会员商品编辑
export function productVipEdit(data) {
  return ajax.post('/admin/product/vip/edit', data)
}

//小店加盟订单列表
export function shoporderSerchordertype(url) {
  return ajax.get('/admin/order/search?' + url)
}

//小店充值淘礼金
export function shopCardTljRecharge(data) {
  return ajax.post('/admin/card/tlj/recharge', data)
}

//小店移除记录
export function shopRemoveListSearch(url) {
  return ajax.get('/admin/shop/remove/search?' + url)
}

//小店移除
export function shopWithShopIdRemove(id, data) {
  return ajax.post('/admin/shop/' + id + '/remove', data)
}

//小店撤销移除
export function revokeRemoveShop(id) {
  return ajax.post('/admin/shop/' + id + '/revoke_remove')
}
